package com.aftersale.demo.entity;

import com.aftersale.demo.utils.ValidGroup;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * 组件
 * @TableName permission
 */
@TableName(value ="permission")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Permission implements Serializable {


    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 权限名
     */
    @NotBlank(message = "权限名不能为空",groups = {ValidGroup.PerName.class})
    @Size(max = 20,min = 4,message = "请确认权限名长度在4-20之间",groups = {ValidGroup.PerName.class})
    private String perName;


    /**
     * 权限描述
     */
    @NotBlank(message = "权限描述不能为空",groups = {ValidGroup.PerName.class})
    @Size(max = 30,min = 4,message = "请确认权限描述长度在4-30之间",groups = {ValidGroup.PerName.class})
    private String perDesc;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}